{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Experimenting with CV Scores\n",
    "\n",
    "``CVScores`` displays cross validation scores as a bar chart with the\n",
    "  average of the scores as a horizontal line."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from sklearn.naive_bayes import MultinomialNB\n",
    "from sklearn.model_selection import StratifiedKFold\n",
    "\n",
    "from yellowbrick.model_selection import CVScores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "from yellowbrick.download import download_all\n",
    "\n",
    "## The path to the test data sets\n",
    "FIXTURES  = os.path.join(os.getcwd(), \"data\")\n",
    "\n",
    "## Dataset loading mechanisms\n",
    "datasets = {\n",
    "    \"bikeshare\": os.path.join(FIXTURES, \"bikeshare\", \"bikeshare.csv\"),\n",
    "    \"concrete\": os.path.join(FIXTURES, \"concrete\", \"concrete.csv\"),\n",
    "    \"credit\": os.path.join(FIXTURES, \"credit\", \"credit.csv\"),\n",
    "    \"energy\": os.path.join(FIXTURES, \"energy\", \"energy.csv\"),\n",
    "    \"game\": os.path.join(FIXTURES, \"game\", \"game.csv\"),\n",
    "    \"mushroom\": os.path.join(FIXTURES, \"mushroom\", \"mushroom.csv\"),\n",
    "    \"occupancy\": os.path.join(FIXTURES, \"occupancy\", \"occupancy.csv\"),\n",
    "    \"spam\": os.path.join(FIXTURES, \"spam\", \"spam.csv\"),\n",
    "}\n",
    "\n",
    "\n",
    "def load_data(name, download=True):\n",
    "    \"\"\"\n",
    "    Loads and wrangles the passed in dataset by name.\n",
    "    If download is specified, this method will download any missing files.\n",
    "    \"\"\"\n",
    "\n",
    "    # Get the path from the datasets\n",
    "    path = datasets[name]\n",
    "\n",
    "    # Check if the data exists, otherwise download or raise\n",
    "    if not os.path.exists(path):\n",
    "        if download:\n",
    "            download_all()\n",
    "        else:\n",
    "            raise ValueError((\n",
    "                \"'{}' dataset has not been downloaded, \"\n",
    "                \"use the download.py module to fetch datasets\"\n",
    "            ).format(name))\n",
    "\n",
    "\n",
    "    # Return the data frame\n",
    "    return pd.read_csv(path)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Classification"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAETCAYAAADZHBoWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XecFdX5x/HP0hbpoCYBEQXRR+MKyGJBQUhiiWiMUbE3jEaisReiUYpRE/1B7A2QiAVjMBLRWKOioNhWEVb0QbEgJaLSQRZZ9vfHmTteLlvu4s42vu/Xa19778zc85y5ZZ45Z2bO5JSUlCAiIgLQoKYrICIitYeSgoiIxJQUREQkpqQgIiIxJQUREYkpKYiISKxRTVdAymZmDYELgBMJn1UT4AlgqLsXVVMdOgMOdHb3BRnzZgLD3f2xcl5fAmwL7Acc6O7nl7JMIfAHd59SQT1GuvvRZtYBeNTd99ucdSql7JbA34B9gQ3R3x3uPrYqyq8KZvYn4GzgBXcftJll3AecBvzC3V9Mm74j8Alwp7v/oYIyUp/nd8Akd/95NH0G0N/dl21O3bKR7eduZp8BxwBfA58CZ6V/lmZ2KZDn7qeb2XDgXGABkEP4jb0DDHb3lQmsRq2nlkLtdhfQm/Aj7gHsBRhQbRsrd/8UeA44PX26mfUG2gCPZ1nO5NISQiXsQFh33H1hVSWEyF+BVUA3d+8OHAYMNbODqzDGD/Vb4MTNTQhp5gEnZ0w7FVhcyXLaAnunnrh7jyQTQhRjcz73DcBIM9ulnGUeierfHc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6m730kYovlMd+9JuIJ2aCnLdwf+5u55hCttTyplmW7AwcA+wB+jsYkGE4a72BUYRBjGoSKpAcx2IySuQwjjAH3m7vmEIdX7uvt/gcnA0GhwwTMJ99zYC/gZGw9xXVrdziMkkN0II4MOja7qHQucGL0fowhX+zYCriAM+JcPbDCz7bJYF6nn1FKQ+iJ9pMqTCSNzDiS0IFqUsvxid383elwItCtlmZfcfR2w2MyWEEbbPAgYE43C+bmZZTNWUaG7zwcwsw+iWK8B10cb4v8Afy7ldZcQxl66gpAE0tejtLr1A0ZHN5T5H7C7meUBOwGTo6ERAFpFI+i+BrwFPA7c4e4LslgXqefUUpD6In1cp6nA3oSb1VxHuHdFpvSx6EsqsUwxlf/dbFJOdPexXQlDmvcF3ixlWO5/EloUswldUBXVbaPh36M7kDUEPnH3HtEB9HxC9xLAkcDvo9c+Y2b9KrleUg8pKUi9YmbtCEOFD3X3pwhdLFU5AujzwPFpI6f2J2yUK1vPPwAj3H0icA7hmEFrwo2XUi34gwjr8TihFZAaGK0srwDHRnX7EeFGM58B7cysb7TMGcAEM9uWMFjcLHcfShi9t1tl10PqHyUFqVfcfQmhD/19M3uXsLFtVoX3khhDuHHLLMJ9jj9n825Bej9gZjaLsDEfHt1+87/AlWZ2DOGOXtOie1IfQtjAdy6nzDuB1cB7UTnnuftywk2CRpnZTMKB5d9GY/HfA7xlZgWEA/L3bcZ6SD2jU1JFKsHMDiN0/zxpZq2Bd4FeUTISqfOUFEQqwcw6E+7HmzroO9LdH6zBKolUKSUFERGJ6ZiCiIjElBRERCSmpCAiIjElBRERiSkpiIhI7P8By/GIhYVyEvsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.naive_bayes import MultinomialNB\n",
    "from sklearn.model_selection import StratifiedKFold\n",
    "\n",
    "from yellowbrick.model_selection import CVScores\n",
    "\n",
    "room = load_data(\"occupancy\")\n",
    "\n",
    "features = [\"temperature\", \"relative humidity\", \"light\", \"C02\", \"humidity\"]\n",
    "\n",
    "# Extract the numpy arrays from the data frame\n",
    "X = room[features].values\n",
    "y = room.occupancy.values\n",
    "\n",
    "# Create a new figure and axes\n",
    "_, ax = plt.subplots()\n",
    "\n",
    "# Create a cross-validation strategy\n",
    "cv = StratifiedKFold(12)\n",
    "\n",
    "# Create the cv score visualizer\n",
    "oz = CVScores(\n",
    "    MultinomialNB(), ax=ax, cv=cv, scoring='f1_weighted'\n",
    ")\n",
    "\n",
    "oz.fit(X, y)\n",
    "oz.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAETCAYAAADZHBoWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XmcVmX5x/HPsA2yQ9rvhyKKmlfWJMS4gIJSKiS2+Ms1zBKjJE0tN3JjccFQ0dw3NA0lFY0iF7RcilXxMYURuQjcEElUdpdBhvn9cd9zfHiYlZkzzAzf9+vFi+es132emTnXue/7nPvklZaWIiIiAtBsWxdAREQaDiUFERFJKCmIiEhCSUFERBJKCiIiklBSEBGRRIttXQDZNsysOXA2MITwe9AK+Bsw0t2L66kMPQAHerj7spxl84DR7v7nSrYvBXYCDgIOd/ezylmnCPiVuz9fRTmudfdjzGxn4BF3P2hrjqmcfbcHrgP6AJviv1vcfUJd7L8umNnFwGnAM+4+dCv3MRo4Ayj7OeYBHYApwLnuXmpmrwAD3H11zrbnAQXufsrWHYHUJSWF7ddtQGfgMHdfY2ZtgQeACcDJ9VEAd3/TzJ4GTgGuL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MJw118FRhKGMahKmUDmO1DSFyDCOMAveXuhYQh1fu7+z+AqcDIOLjgMMI7N/YHvsXmQ1yXV7YzCQlkH8LIoCPjU70TgCHx+xhPeNq3BXAhYcC/QmCTme1SjWORJk41BWkqskeq/DFhZM7jCDWIduWsv8Ld/x0/FwFdylnnOXffAKwws5WE0TaPAO6Ko3C+bWbVGauoyN3fBTCz12OsWcDYeCJ+HLi8nO3OJYy9dCEhCWQfR3llOxS4M75Q5r/A182sANgTmBqHRgDoEEfQnQXMBf4K3OLuy6pxLNLEqaYgTUX2uE7TgQMIL6u5kvDuilzZY9GX1mCdEmr+d7PFfuLbx75KGNK8P/BiOcNyP0yoUSwgNEFVVbbNhn+PbyBrDrzh7r1iB3ohoXkJ4Gjgl3HbaWZ2aA2PS5ogJQVpUsysC2Go8JHu/gShiaUuRwD9O3Bi1sipAwgn5ZqW81fAGHefDJxO6DPoSHjxUlkN/gjCcfyVUAsoGxitIv8Cjo9l+zLhRTNvAV3MrH9c51RgkpntRBgsbr67jySM3rtvTY9Dmh4lBWlS3H0loQ39NTP7N+Fk26YO3yVxF+HFLfMJ7zl+m617BekfATOz+YST+ej4+s1/ABeZ2bGEN3rNiO+kHkQ4wfeoZJ+3Ah8Dr8b9nOnuawgvCRpvZvMIHcs/i2Px3wHMNbMMoUP+3q04DmlidEuqSA2Y2VGE5p/HzKwj8G9gv5iMRBo9JQWRGjCzHoT38ZZ1+l7r7vdvwyKJ1CklBRERSahPQUREEkoKIiKSUFIQEZGEkoKIiCSUFEREJPH/7qys+T2EDmgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.linear_model import Ridge\n",
    "from sklearn.model_selection import KFold\n",
    "\n",
    "\n",
    "energy = load_data(\"energy\")\n",
    "\n",
    "targets = [\"heating load\", \"cooling load\"]\n",
    "features = [col for col in energy.columns if col not in targets]\n",
    "\n",
    "X = energy[features]\n",
    "y = energy[targets[1]]\n",
    "\n",
    "# Create a new figure and axes\n",
    "_, ax = plt.subplots()\n",
    "\n",
    "cv = KFold(12)\n",
    "\n",
    "oz = CVScores(\n",
    "    Ridge(), ax=ax, cv=cv, scoring='r2'\n",
    ")\n",
    "\n",
    "oz.fit(X, y)\n",
    "oz.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
